/*
 * Copyright (C) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

export function getFullName(firstName) {
  let a = firstName;
  return a;
}

export function getFullAge(age) {
  let a = age;
  return a;
}

export function getFullNameDefault(firstName = 'tom') {
  let a = firstName;
  return a;
}

export function getFullNameMultipleDefault(firstName = 'tom', lastName = 18) {
  let a = firstName;
  let b = lastName;
  return a;
}

export function MultipleTypes(name, age) {
  let a = name;
  let b = age;
  return a;
}

export function TheDefaultParametersAreMissing(name = 'Tom', age) {
  let a = name;
  let b = age;
  return a;
}

export function SingleElement(arr) {
  return [1, 2, ...arr];
}

export function MultipleElements(arr, arr1) {
  return [1, 2, ...arr, ...arr1];
}

export function MultipleDefaultParameters(arr = [3, 5], arr1 = [4, 6]) {
  return [1, 2, ...arr, ...arr1];
}

export function OperationDeconstruction(arr) {
  const sum = (a, b) => a + b;
  const numbers = arr;
  return computing = sum(numbers);
}

export function MultipleOperationDeconstruction(arr) {
  const sum = (a, b = 1) => a + b;
  const numbers = arr;
  return computing = sum(numbers);
}

export function TwoDefaultParameters(arr) {
  const sum = ([a = 1, b = 1]) => a + b;
  const numbers = arr;
  return computing = sum(numbers);
}

export function MultiElementArray(arr, arr1) {
  const sum = ([a, b], [c, d]) => a + b + c + d;
  const numbers = [arr, arr1];
  return computing = sum(numbers);
}

